import type { IntercityOrder } from '@/types/api'

interface FetchIntercityOrderListAPIResData {
  code: number
  msg: string
  time: string
  data: {
    total: number
    per_page: number
    current_page: number
    last_page: number
    data: IntercityOrder[]
  }
}

interface FetchIntercityOrderListAPIParams {
  page: string
  limit: string
  status: string
}

export function fetchIntercityOrderListAPI(params: FetchIntercityOrderListAPIParams, token: string) {
  return httpInstance.get<FetchIntercityOrderListAPIResData, FetchIntercityOrderListAPIParams>(
    '/api/intercity/orderlist',
    { params, headers: { token } },
  )
}
